<template>
	<el-dialog title="流程检测结果对话框" v-model="visible" customClass="customWidth" destroy-on-close @closed="$emit('closed')">
		<el-main class="nopadding">
			<scTable ref="table" :data="tableData" row-key="stepId"  stripe remoteSort remoteFilter>
				<el-table-column label="#" type="index" width="50"></el-table-column>
				<el-table-column label="步骤名称" prop="stepName" width="200" :show-overflow-tooltip="true"></el-table-column>
				<el-table-column label="经办人" prop="userFlag" width="100">
					<template #default="scope">
						<el-tag v-if="scope.row.userFlag=='1'" type="success">已设</el-tag>
						<el-tag v-else type="warning">缺失</el-tag>
					</template>
				</el-table-column>
				<el-table-column label="主办设置" prop="opRule" width="100">
					<template #default="scope">
						<el-tag v-if="scope.row.opRule=='0'" type="success">指定</el-tag>
						<el-tag v-else-if="scope.row.opRule=='1'" type="warning">先接收</el-tag>
						<el-tag v-else-if="scope.row.opRule=='2'" type="danger">后接收</el-tag>
						<el-tag v-else-if="scope.row.opRule=='3'" type="info">无主办</el-tag>
						<el-tag v-else>未知</el-tag>
					</template>
				</el-table-column>
				<el-table-column label="可写字段" prop="writerFieldFlag" width="100">
					<template #default="scope">
						<el-tag v-if="scope.row.writerFieldFlag==1" type="success">已设</el-tag>
						<el-tag v-else type="warning">缺失</el-tag>
					</template>
				</el-table-column>
				<el-table-column label="附件权限" prop="publicFileFlag" width="100">
					<template #default="scope">
						<el-tag v-if="scope.row.publicFileFlag=='0'" type="danger">禁用</el-tag>
						<el-tag v-else-if="scope.row.publicFileFlag=='1'">查看</el-tag>
						<el-tag v-else-if="scope.row.publicFileFlag=='2'" type="warning">下载</el-tag>
						<el-tag v-else-if="scope.row.publicFileFlag=='3'" type="info">打印</el-tag>
						<el-tag v-else-if="scope.row.publicFileFlag=='4'" type="success">编辑</el-tag>
						<el-tag v-else>缺失</el-tag>
					</template>
				</el-table-column>
				<el-table-column label="转交条件" prop="conditionFlag" width="100">
					<template #default="scope">
						<el-tag v-if="scope.row.conditionFlag==1" type="success">已设</el-tag>
						<el-tag v-else type="warning">缺失</el-tag>
					</template>
				</el-table-column>
			</scTable>
			<div class="el-form-item-msg">主要为测检直接影响流程运行关键信息设置情况,并非全部。</div>
		</el-main>
		<template #footer>
			<el-button @click="visible=false" >关闭</el-button>
		</template>
	</el-dialog>
</template>

<script>
export default {
	props:{
		flowId:{type:String}
	},
	components: {
	},
	emits: ['success', 'closed'],
	data() {
		return {
			visible: false,
			tableData:[],
		}
	},
	mounted() {
		this.getTestBpmFlowResultList();
	},
	methods: {
		open(){
			this.visible = true;
			return this
		},
		async getTestBpmFlowResultList(){
			var res = await this.$API.bpm.bpmFlow.getTestBpmFlowResultList.get({flowId:this.flowId});
			if (res.code == 200) {
				this.tableData=res.data;
			} else {
				this.$alert(res.message, "提示", {type: 'error'})
			}
		},
	}
}
</script>
<style>
.customWidth {
	width: 60%;
}
</style>
